#ifndef TPERSON_H
#define TPERSON_H

#include <QObject>

class TPerson : public QObject
{
    Q_OBJECT

    Q_CLASSINFO("author", "Jiang")
    Q_CLASSINFO("company", "lsgx")
    Q_CLASSINFO("version", "1.0.1")

    Q_PROPERTY(QString name MEMBER m_name)
    Q_PROPERTY(int age READ age WRITE setAge NOTIFY ageChanged)
    Q_PROPERTY(int score MEMBER m_score)

private:
    QString m_name;
    int m_age = 10;
    int m_score = 79;

signals:
    void ageChanged(int value);

public:
    unsigned age();
    void setAge(int value);
    void incAge();

public:
    explicit TPerson(QString aName, QObject *parent = nullptr);
    virtual ~TPerson();

private:
    Q_DISABLE_COPY(TPerson)
};

#endif // TPERSON_H
